package output;

import java.io.FileOutputStream;
import java.io.IOException;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;

public class CoverSheetTest {
	public static void main(String[] args) {
		Document document = new Document();
		try {
			PdfWriter.getInstance(document, new FileOutputStream("results/test1.pdf"));
			document.open();
			document.add(new Paragraph("Academic Output Coversheet"));
			document.add(new Paragraph(" "));

			PdfPTable table1 = new PdfPTable(1);
			table1.addCell("ID NUMBER");
			document.add(table1);
			document.add(new Paragraph(" "));

			PdfPTable table2 = new PdfPTable(2);

			table2.addCell("Name:");
			table2.addCell("AcademicName");

			table2.addCell("Staff Id:");
			table2.addCell("XXXX");

			table2.addCell("Unit:");
			table2.addCell("Seat");

			table2.addCell("MailCode:");
			table2.addCell("PN 321");

			document.add(table2);
			document.add(new Paragraph(" "));

			PdfPTable table3 = new PdfPTable(2);
			PdfPCell cell = new PdfPCell(new Paragraph("Output Details (Optional)"));
			cell.setColspan(2);
			cell.setHorizontalAlignment(cell.ALIGN_CENTER);
			table3.addCell(cell);

			table3.addCell("Author(s)");
			table3.addCell("Jens Dietrich, Chris Elgar");

			table3.addCell("Article / output title");
			table3.addCell("Towards a web of patterns");

			table3.addCell("Journal / Publication Title");
			table3.addCell("Web Semantics: Science, services and Agents of the World wide Web");

			table3.addCell("Publication Year");
			table3.addCell("2007");

			table3.addCell("Publisher");
			table3.addCell("Elsevier");

			table3.addCell("ISSN");
			table3.addCell("ISSN: 1570-6266");

			table3.addCell("Volume / number");
			table3.addCell("Volume 5: Issue2");

			table3.addCell("Page Numbers");
			table3.addCell("108-116");

			table3.addCell("URL Address (if applicable)");
			table3.addCell("10.1016/j.websem.2006.11.007");

			document.add(table3);
			document.add(new Paragraph(" "));

			PdfPTable table4 = new PdfPTable(3);
			PdfPCell cell2 = new PdfPCell(new Paragraph("Is this output:"));
			cell2.setColspan(3);
			table4.addCell(cell2);

			table4.addCell("Research or Professional/Community?");
			table4.addCell("Quality Assured?");
			table4.addCell("Confidential?");

			table4.addCell("Research");
			table4.addCell("Yes");
			table4.addCell("No");

			document.add(table4);
			document.add(new Paragraph(" "));


			PdfPTable table6 = new PdfPTable(2);
			table6.addCell("Journal Contribution:");
			table6.addCell("Full article in journal");

			document.add(table6);
			document.add(new Paragraph(" "));

			PdfPTable table5 = new PdfPTable(2);
			PdfPCell cell4 = new PdfPCell(new Paragraph("Verfication Checklist"));
			cell4.setColspan(2);
			table5.addCell(cell4);

			table5.addCell("Author(s)");
			table5.addCell("Y");

			table5.addCell("Article / outputfile");
			table5.addCell("Y");

			table5.addCell("Journal / publication");
			table5.addCell("Y");

			table5.addCell("Publication year");
			table5.addCell("Y");

			table5.addCell("Publisher");
			table5.addCell("Y");

			table5.addCell("ISSN");
			table5.addCell("Y");

			table5.addCell("Volume / Number");
			table5.addCell("Y");

			table5.addCell("Page/number");
			table5.addCell("Y");

			table5.addCell("Page numbers");
			table5.addCell("Y");

			table5.addCell("URL Adress");
			table5.addCell("Y");

			document.add(table5);
			document.add(new Paragraph(" "));


			PdfPTable table7 = new PdfPTable(2);
			table7.addCell("Receipt Required?");
			table7.addCell("Y");

			document.add(table7);
			document.add(new Paragraph(" "));

			PdfPTable table8 = new PdfPTable(2);
			table7.addCell("Date Received (office use only)");
			table7.addCell(" ");

			document.add(table8);

		} catch (DocumentException de) {
			System.err.println(de.getMessage());
		} catch (IOException ioe) {
			System.err.println(ioe.getMessage());
		}
		document.close();
	}
}
